<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>显示</title>
		<style>
			#div{
				width: 380px;
				height: 380px;
				margin-left: 180px;
				margin-top: -100px;
			
			}
			#div1{
				margin-left: 50px;
				background-color: red;
				width: 100px;
				height: 100px;
			}
			
		</style>
	</head>
	<body>
		<div id="div1" onmouseover="over()" onmouseleave="leave()"></div>
		<div id="div" ></div>
		<script>
			var div=document.getElementById('div');
			function over(){
				div.style.background='gray';
			}
			function leave(){
				setTimeout(time,2000);
			}
			function time(){
			div.style.background='white';
			}
		</script>
	</body>
</html>